Media content represents images, video, audio, text, presentations, and other digital content that span some duration. The media content is streamed over a digital network, such as the Internet, to different network enabled clients (e.g., computers, tablets, smartphones, set-top boxes, etc.) by encoding the media content as a set of segments and performing a serialized delivery of the segments to the clients with each segment representing a short duration of the overall stream. The segmented encoding and delivery of the media content allows clients to start, resume, or skip to a particular playback position by simply requesting the segment corresponding to that particular position. The segmented encoding further allows clients to immediately switch between different encodings of the same media stream, wherein the different encodings provide the media stream at different bitrates or quality levels.
Providing an uninterrupted streaming experience is technically challenging because of the time sensitive manner with which the client-server exchange for segment delivery occurs. The client is continually requesting segments ahead of its current playback position to account for the network propagation time, server response time, and client rendering time. Any delay in the server response to a requested segment can result in interrupted playback or buffering at the client. This and other factors beyond server control, including network congestion, can disrupt the end user experience and ultimately cause the client to cease playback. Various server-side techniques attempt to mitigate playback issues on the client by improving the responsiveness with which the server obtains and sends segments in response to client requests for those segments.
One such technique is to locally cache the segments for a requested stream at the streaming server such that there is no additional retrieval of the segments from a remote location. Local caching becomes more impractical as the stream length or duration increases. Streams that are several minutes long and encoded with different bitrates can consume gigabytes worth of cache. The server may have insufficient memory for caching such large content or may not want to dedicate a large portion of memory to caching of a single stream, especially in a multi-tenant environment in which the server is tasked with serving other streams or content. Moreover, server performance would be adversely affected as other popular content or streams would be ejected from cache, causing the server to re-retrieve that content from remote storage in order to respond to received client requests. Locally caching is also wasteful when treating all streams or media content the same. In particular, cache resources would be wasted when consumed with a stream that is requested by one or a few clients.
Rather than cache the entire stream, an alternate technique for accelerating retrieval and serving of stream segments is to prefetch and cache a subset of segments ahead of a current client playback position. This technique is referred to as prefetching. Prefetching is also wasteful when treating all streams or media content the same. In particular, bandwidth is wasted in unnecessarily prefetching segments for a particular stream when there is a single or limited number of clients watching the stream and those clients prematurely end playback, switch to a different stream, or switch to a different bitrate encoding of the stream, and thereby never request the prefetched segments. In addition to wasted bandwidth, uniform prefetching also wastes caching resources as prefetched segments that are never requested simply sit and consume cache at the expense of other popular content that can be more efficiently served if in cache.
Accordingly, there is a need for a solution for accelerating the delivery of media content streams to clients without uniformly caching or prefetching segments of different streams. Stated differently, there is a need for a streaming solution that is adaptive based on stream demand and actual consumption.